﻿// JScript 文件

var ureg={
    check:function(u){
        
    }
};

function checkuser(u)
{
    $.get("s/svr.aspx",{cmd:"10000",u:u},
        function(res)
        {
            showResult_UserName(res);
//            alert(res);
//            if ( res == "0")
//            {
//                alert("ok");
//            }
//            else
//            {
//                alert("failed:"+res);
//            }
            //alert(json.b);
        }
        );
}

function showResult_UserName(x)
{
	var ResultContent_UserName;
	//var Result_UserName = parseInt(x.responseText);
	var Result_UserName = x;
	//alert(Result_UserName);
	if (Result_UserName==0)
	{
		ResultContent_UserName='<img src="res/img/icon_ok.gif" width="16" height="16">&nbsp;<FONT COLOR="blue">'+document.forms['form1'].login_name.value+' 可使用</FONT>';
		document.getElementById("login_name").style.backgroundColor = "";
		document.getElementById("login_name").style.color = "";
	}
	

	if (Result_UserName==1)
	{
		ResultContent_UserName='<img src="res/img/icon_errow.gif" width="16" height="16">&nbsp;<FONT COLOR="red">用户名已被使用</FONT>';
		document.getElementById("login_name").style.backgroundColor = "#FFCCCC";
		document.getElementById("login_name").style.color = "#000000";
	}
	//20081201 end
	if (Result_UserName==3)
	{
		ResultContent_UserName='<img src="res/img/icon_errow.gif" width="16" height="16">&nbsp;<FONT COLOR="red">含有系统屏蔽字符</FONT>';
		document.getElementById("login_name").style.backgroundColor = "#FFCCCC";
		document.getElementById("login_name").style.color = "#000000";
	}
	if (Result_UserName==4)
	{
		ResultContent_UserName='<img src="res/img/icon_errow.gif" width="16" height="16">&nbsp;<FONT COLOR="red">含有系统保留字符</FONT>';
		document.getElementById("login_name").style.backgroundColor = "#FFCCCC";
		document.getElementById("login_name").style.color = "#000000";
	}
	if (Result_UserName==5)
	{
		ResultContent_UserName='<img src="res/img/icon_errow.gif" width="16" height="16">&nbsp;<FONT COLOR="red">用户名检测失败</FONT>';
		document.getElementById("login_name").style.backgroundColor = "#FFCCCC";
		document.getElementById("login_name").style.color = "#000000";
	}
	if (Result_UserName==6)
	{
		ResultContent_UserName='<img src="res/img/icon_errow.gif" width="16" height="16">&nbsp;<FONT COLOR="red">用户名不能超过8个汉字</FONT>';
		document.getElementById("login_name").style.backgroundColor = "#FFCCCC";
		document.getElementById("login_name").style.color = "#000000";
	}

	document.getElementById("CheckUserNameResult").innerHTML = ResultContent_UserName;
}